<div>
    <ol class="breadcrumb">
        <li> <i class="fa fa-anchor"></i>
            &nbsp;常态监控
        </li>
        <li>首页</li>
    </ol>
    <div class="panel">
        <div class="panel-heading">
            <i class="fa fa-list">&nbsp;&nbsp;常态监控</i>
        </div>
        <div class="panel-body search-panel-body">
            <div class="col-xs-1">
                <a href="__URL__/index/oldtime/30" class="btn btn-warning">&nbsp;&nbsp;前30天&nbsp;</a>
            </div>
            <form class="search-form" action="__ACTION__" method="get">
                <div class="col-xs-3 search-col retract">
                    <div class="input-group">
                        <span class="input-group-addon">更多选择</span>
                        <input type="text" class="form-control form_month" placeholder="点击选择" name="month"  value="{$_GET['month']}"  data-date-format="yyyy-mm" data-link-format="yyyy-mm">
                    </div>
                </div>&nbsp;
                <button  type="submit" class="btn btn-warning">
                    <i class="fa fa-search"></i>
                    &nbsp;搜索
                </button>
            </form>
        </div>
        <br />
        <form class="search-form" action="__ACTION__" method="get" onsubmit="return show_first_page();">
            <div class="panel-body search-panel-body">
                <div class="col-xs-3 search-col retract">
                    <div class="input-group">
                        <!-- <span class="input-group-addon">运营二维码</span>
                         <input type="text" class="form-control" placeholder="运营二维码" name="evc_number" maxlength="12" value="{$_GET['evc_number']}">-->
                        <span class="input-group-addon">设备地址</span>
                        <input type="text" class="form-control" placeholder="设备地址" name="key_link" maxlength="16" value="{$_GET['key_link']}">
                    </div>
                </div>
                <div class="col-xs-8 search-col retract">
                    <div class="input-group">
                        <span class="input-group-addon">所在地</span>
                        <select id="location-f" name="location_f_1" class="form-control" style="width:auto;">
                            <option value="0">--</option>
                            <volist name="china" id="vo">
                                <option value="{$vo.code}">{$vo.name}</option>
                            </volist>
                        </select>

                        <select id="location-s" name="location_s_1" class="form-control" style="width:auto;border-left:0">
                            <option value="0">--</option>
                            <volist name="china" id="vo">
                                <volist name="vo['area']" id="vovo">
                                    <option value="{$vovo.code}" class="{$vo.code}" >{$vovo.name}</option>
                                </volist>
                            </volist>
                        </select>

                        <select id="location-t" name="location_t_1" class="form-control required" style="width:auto;border-left:0">
                            <option value="0">--</option>
                            <volist name="china" id="vo">
                                <volist name="vo['area']" id="vovo">
                                    <volist name="vovo['area']" id="vovovo">
                                        <option value="{$vovovo.code}" class="{$vovo.code}" >{$vovovo.name}</option>
                                    </volist>
                                </volist>
                            </volist>
                        </select>&nbsp;

                        <button  type="submit" class="btn btn-warning">
                            <i class="fa fa-search"></i>
                            &nbsp;搜索
                        </button>
                    </div>
                </div>
            </div>

            <table  class="table table-bordered table-striped table-mcit" >
                <thead>
                <tr>
                    <th width="25%">
                        <button class='btn btn-block btn-mcit' type='button'>基础信息</button>
                    </th>
                    <th width="20%">
                        <button class='btn btn-block btn-mcit' type='button'>运营二维码/设备地址</button>
                    </th>
                    <th>
                        <button class='btn btn-block btn-mcit' type='button'><i class="fa fa-hand-o-down"></i>&nbsp;点击各色块查看当天状态</button>
                    </th>
                </tr>
                </thead>
                <tbody id="DataTableContent">
                <empty name="normalcy">
                    <td colspan="99" style="text-align:center" class="danger"> <strong><i class="fa fa-meh-o"></i>
                        &nbsp;&nbsp;当前条件下没有数据</strong>
                    </td>
                    <else />
                    <volist name="normalcy" id="data">
                        <tr>
                            <td>
                                <p>站点名称：{$data.name}</p>
                                <p>所在区域：{$data.location_text}</p>
                            </td>
                            <td>
                                <p>运营二维码：{$data.evc_number}</p>
                                <p>设 备 地 址：{$data.key_link}</p>
                            </td>
                            <td>
                                <p align="center" style="margin: 0;padding: 0">日期：{$data.month}</p>
                                <volist name="data['detail']" id="da">
                                    <a class='btn  {$da.colors} detail' style="width: 50px;height: 30px;margin-bottom: 2px;margin-left: 2px" data-text="{$da.currentTime}" data-code="{$da.key_link}" href="#confirmDeletes" data-target="#confirmDeletes" data-toggle="modal">
                                        {$da.day}
                                    </a>
                                    <!--<button class='btn  {$da.colors} detail' style="width: 70px;height: 40px;margin-bottom: 5px;margin-left: 5px" data-text="{$da.currentTime}" data-code="{$da.key_link}" type='button'>{$da.day}</button>-->
                                </volist>
                            </td>
                        </tr>
                    </volist>
                </empty>
                <tr>
                    <td colspan="99" style="text-align:center">
                        <ul class="pagination">{$pageView}</ul>
                    </td>
                </tr>
                </tbody>
            </table>
            <input type="hidden" name="fsign" id="fsign" value="normal">
        </form>
    </div>
</div>
<!-- 24小时-弹窗 -->
<div id="confirmDeletes" class="modal  fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4>
                    <i class="fa fa-list">&nbsp;&nbsp;心跳记录数</i>
                </h4>
            </div>
            <div class="modal-body alert-danger" id="stateHtml" align="center" >

            </div>
            <div class="modal-footer">
                <a class="btn btn-default btn-sm" data-dismiss="modal" aria-hidden="true" id="modelCloses">关闭</a>
            </div>
        </div>
    </div>
</div>
<import file="js.jquery#chained" />
<import type='css' file="css.datetimepicker" />
<import file="js.bootstrap-datetimepicker#min" />
<import file="js.bootstrap-datetimepicker#zh-CN" />
<import file="js.maskedinput" />
<script type="text/javascript">
    function show_first_page(){
        $("#fsign").val("abnormal");
        return true;
    }
    $(document).ready(function () {
        $("#location-s").chained("#location-f");
        $("#location-t").chained("#location-s");

        $(".form_month").datetimepicker({
            language: 'zh-CN',
            autoclose: true,
            startView:'year',
            minView: 'year',
            todayBtn: false,
            viewSelect: 'year',
            pickerPosition: "bottom-left"
        });

        $(".detail").click(function (){
            var today    = $(this).attr("data-text");
            var key_link = $(this).attr("data-code");
//            alertify.success(today);
//            alertify.success(key_link);
            $.ajax({
                type:"post",
                url:'__URL__/todays',
                data:{today:today,key_link:key_link},
//                dataType: "json",
                success:function(data){
                    $("#stateHtml").html(data);
                }
            });
        });
    })
</script>